﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Common;
    using DotNetNuke.Common.Utilities;
    using DotNetNuke.Entities.Modules;
    using DotNetNuke.Security;
    using DotNetNuke.Services.Exceptions;
    using DotNetNuke.Services.Localization;
    using DotNetNuke.UI.Skins;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections;
    using System.Runtime.CompilerServices;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class AdminOrders : BaseAdminModule
    {
        [AccessedThroughProperty("cartlist1")]
        private CartList _cartlist1;
        [AccessedThroughProperty("cmdAddProduct")]
        private LinkButton _cmdAddProduct;
        [AccessedThroughProperty("cmdCreate")]
        private LinkButton _cmdCreate;
        [AccessedThroughProperty("cmdEditOrder")]
        private LinkButton _cmdEditOrder;
        [AccessedThroughProperty("cmdPrintOrder")]
        private LinkButton _cmdPrintOrder;
        [AccessedThroughProperty("cmdPrintreceipt")]
        private LinkButton _cmdPrintreceipt;
        [AccessedThroughProperty("cmdReOrder")]
        private LinkButton _cmdReOrder;
        [AccessedThroughProperty("cmdReturn")]
        private LinkButton _cmdReturn;
        [AccessedThroughProperty("cmdReturn2")]
        private LinkButton _cmdReturn2;
        [AccessedThroughProperty("cmdSelect")]
        private LinkButton _cmdSelect;
        [AccessedThroughProperty("cmdSendAmendEmail")]
        private LinkButton _cmdSendAmendEmail;
        [AccessedThroughProperty("cmdSendReceiptEmail")]
        private LinkButton _cmdSendReceiptEmail;
        [AccessedThroughProperty("cmdSendShipEmail")]
        private LinkButton _cmdSendShipEmail;
        [AccessedThroughProperty("cmdSendValidateOrder")]
        private LinkButton _cmdSendValidateOrder;
        [AccessedThroughProperty("cmdUpdate")]
        private LinkButton _cmdUpdate;
        [AccessedThroughProperty("CompareValidator1")]
        private CompareValidator _CompareValidator1;
        [AccessedThroughProperty("cvFromDate")]
        private CompareValidator _cvFromDate;
        [AccessedThroughProperty("cvToDate")]
        private CompareValidator _cvToDate;
        [AccessedThroughProperty("ddlSearch")]
        private DropDownList _ddlSearch;
        [AccessedThroughProperty("ddlStatus")]
        private DropDownList _ddlStatus;
        [AccessedThroughProperty("dgOrderList")]
        private DataGrid _dgOrderList;
        [AccessedThroughProperty("EditBAddrForm")]
        private Address _EditBAddrForm;
        private string _EditData;
        [AccessedThroughProperty("EditSAddrForm")]
        private Address _EditSAddrForm;
        [AccessedThroughProperty("hypFromDate")]
        private HyperLink _hypFromDate;
        [AccessedThroughProperty("hypShipDate")]
        private HyperLink _hypShipDate;
        [AccessedThroughProperty("hypToDate")]
        private HyperLink _hypToDate;
        [AccessedThroughProperty("lblAlreadyPaid")]
        private Label _lblAlreadyPaid;
        [AccessedThroughProperty("lblFrom")]
        private Label _lblFrom;
        [AccessedThroughProperty("lblName")]
        private Label _lblName;
        [AccessedThroughProperty("lblOrderEmail")]
        private Label _lblOrderEmail;
        [AccessedThroughProperty("lblOrderNbr")]
        private Label _lblOrderNbr;
        [AccessedThroughProperty("lblPopupMsg")]
        private Label _lblPopupMsg;
        [AccessedThroughProperty("lblShipDate")]
        private Label _lblShipDate;
        [AccessedThroughProperty("lblStatus")]
        private Label _lblStatus;
        [AccessedThroughProperty("lblTo")]
        private Label _lblTo;
        [AccessedThroughProperty("lblTrackCode")]
        private Label _lblTrackCode;
        private int _OrdId;
        [AccessedThroughProperty("plhOrder")]
        private PlaceHolder _plhOrder;
        [AccessedThroughProperty("pnlEdit")]
        private Panel _pnlEdit;
        [AccessedThroughProperty("pnlOrderEdit")]
        private Panel _pnlOrderEdit;
        [AccessedThroughProperty("pnlOrderList")]
        private Panel _pnlOrderList;
        [AccessedThroughProperty("pnlUpdate")]
        private Panel _pnlUpdate;
        private bool _RecalcCart;
        private Hashtable _StatusList;
        [AccessedThroughProperty("txtAlreadyPaid")]
        private TextBox _txtAlreadyPaid;
        [AccessedThroughProperty("txtEditNoteMsg")]
        private TextBox _txtEditNoteMsg;
        [AccessedThroughProperty("txtFilter")]
        private TextBox _txtFilter;
        [AccessedThroughProperty("txtFromDate")]
        private TextBox _txtFromDate;
        [AccessedThroughProperty("txtOrderEmail")]
        private TextBox _txtOrderEmail;
        [AccessedThroughProperty("txtOrderNbr")]
        private TextBox _txtOrderNbr;
        [AccessedThroughProperty("txtShipDate")]
        private TextBox _txtShipDate;
        [AccessedThroughProperty("txtToDate")]
        private TextBox _txtToDate;
        [AccessedThroughProperty("txtTrackCode")]
        private TextBox _txtTrackCode;
        private int _UsrId;

        public AdminOrders()
        {
            base.Init += new EventHandler(this.Page_Init1);
            base.Load += new EventHandler(this.Page_Load);
            this._RecalcCart = false;
        }

        private void cartlist1_RecalculateCart()
        {
            this.updateOrder();
            if ((this.Request.QueryString["uid"] != null) & (this.Request.QueryString["rtnctl"] != null))
            {
                this.Response.Redirect(this.EditUrl("OrdId", this._OrdId.ToString(), "AdminOrders", new string[] { "uid=" + this.Request.QueryString["uid"], "rtnctl=" + this.Request.QueryString["rtnctl"], "ed=1", "rc=1" }));
            }
            else
            {
                this.Response.Redirect(this.EditUrl("OrdId", this._OrdId.ToString(), "AdminOrders", new string[] { "ed=1", "rc=1" }));
            }
        }

        private void cmdAddProduct_Click(object sender, EventArgs e)
        {
            this.updateOrder();
            string editUrl = this.GetEditUrl(this._OrdId);
            string storeSetting = SharedFunctions.GetStoreSetting(this.PortalId, "store.tab");
            SharedFunctions.setAdminCookieValue(this.PortalId, "OrderEditRtnURL", editUrl);
            if (Versioned.IsNumeric(storeSetting))
            {
                this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(Conversions.ToInteger(storeSetting)));
            }
        }

        private void cmdCreate_Click(object sender, EventArgs e)
        {
            NB_Store_OrdersInfo info = new OrderController().CreateEmptyOrder(Conversions.ToString(this.PortalId), this.UserId);
            this.Response.Redirect(this.GetEditUrl(info.OrderID));
        }

        private void cmdEditOrder_Click(object sender, EventArgs e)
        {
            this.Response.Redirect(this.GetEditUrl(this._OrdId));
        }

        private void cmdPrintOrder_Click(object sender, EventArgs e)
        {
            this.Response.Write("<script>window.open('" + DotNetNuke.Common.Globals.NavigateURL(this.TabId, "PrintOrder", new string[] { "mid=" + this.ModuleId.ToString(), "ORID=" + this._OrdId.ToString() + "&SkinSrc=" + DotNetNuke.Common.Globals.QueryStringEncode("[G]" + SkinInfo.RootSkin + "/_default/No Skin"), "ContainerSrc=" + DotNetNuke.Common.Globals.QueryStringEncode("[G]" + SkinInfo.RootContainer + "/_default/No Container"), "dnnprintmode=true" }) + "','_blank')</script>");
            this.populateOrderView(this._OrdId);
        }

        private void cmdPrintreceipt_Click(object sender, EventArgs e)
        {
            this.Response.Write("<script>window.open('" + DotNetNuke.Common.Globals.NavigateURL(this.TabId, "PrintOrder", new string[] { "mid=" + this.ModuleId.ToString(), "ORID=" + this._OrdId.ToString() + "&inv=1&SkinSrc=" + DotNetNuke.Common.Globals.QueryStringEncode("[G]" + SkinInfo.RootSkin + "/_default/No Skin"), "ContainerSrc=" + DotNetNuke.Common.Globals.QueryStringEncode("[G]" + SkinInfo.RootContainer + "/_default/No Container"), "dnnprintmode=true" }) + "','_blank')</script>");
            this.populateOrderView(this._OrdId);
        }

        private void cmdReOrder_Click(object sender, EventArgs e)
        {
            CurrentCart.CreateCartFromOrder(Conversions.ToString(this.PortalId), this._OrdId, true);
            int tabID = SharedFunctions.GetStoreSettingInt(this.PortalId, "checkout.tab", SharedFunctions.GetCurrentCulture());
            this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(tabID));
        }

        private void cmdReturn_Click(object sender, EventArgs e)
        {
            if (this.ModuleConfiguration.ModuleControl.ControlType == SecurityAccessLevel.Edit)
            {
                if ((this.Request.QueryString["uid"] != null) & (this.Request.QueryString["rtnctl"] != null))
                {
                    this.Response.Redirect(this.EditUrl("uid", this.Request.QueryString["uid"], this.Request.QueryString["rtnctl"]));
                }
                else
                {
                    this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
                }
            }
            else
            {
                this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
            }
        }

        private void cmdReturn2_Click(object sender, EventArgs e)
        {
            if (this.ModuleConfiguration.ModuleControl.ControlType == SecurityAccessLevel.Edit)
            {
                this.RedirectAfterEdit();
            }
            else
            {
                this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
            }
        }

        private void cmdSelect_Click(object sender, EventArgs e)
        {
            this.SaveSearchCriteria();
            this.dgOrderList.CurrentPageIndex = 0;
            this.populateOrderList(this._UsrId);
        }

        private void cmdSendAmendEmail_Click(object sender, EventArgs e)
        {
            this.updateOrder();
            this.SendOrderEmail("orderamended.email");
            this.RedirectAfterEmail();
        }

        private void cmdSendReceiptEmail_Click(object sender, EventArgs e)
        {
            this.updateOrder();
            this.SendOrderEmail("orderreceipt.email");
            this.RedirectAfterEmail();
        }

        private void cmdSendShipEmail_Click(object sender, EventArgs e)
        {
            this.updateOrder();
            this.SendOrderEmail("ordershipped.email");
            this.RedirectAfterEmail();
        }

        private void cmdSendValidateOrder_Click(object sender, EventArgs e)
        {
            this.updateOrder();
            this.SendOrderEmail("ordervalidated.email");
            this.RedirectAfterEmail();
        }

        private void cmdUpdate_Click(object sender, EventArgs e)
        {
            this.updateOrder();
            this.RedirectAfterEdit();
        }

        private void ddlSearch_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.SaveSearchCriteria();
            this.dgOrderList.CurrentPageIndex = 0;
            this.populateOrderList(this._UsrId);
        }

        private void dgOrderList_EditCommand(object source, DataGridCommandEventArgs e)
        {
            int num = int.Parse(e.CommandArgument.ToString());
            if (this.ModuleConfiguration.ModuleControl.ControlType == SecurityAccessLevel.Edit)
            {
                this.SaveSearchCriteria();
                if ((this.Request.QueryString["uid"] != null) & (this.Request.QueryString["rtnctl"] != null))
                {
                    this.Response.Redirect(this.EditUrl("OrdId", num.ToString(), "AdminOrders", new string[] { "uid=" + this.Request.QueryString["uid"], "rtnctl=" + this.Request.QueryString["rtnctl"] }));
                }
                else
                {
                    this.Response.Redirect(this.EditUrl("OrdId", num.ToString(), "AdminOrders"));
                }
            }
            else
            {
                this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabId, "", new string[] { "OrdId=" + num.ToString() }));
            }
        }

        private void dgOrderList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            int orderID = int.Parse(e.CommandArgument.ToString());
            if (e.CommandName == "gotocart")
            {
                string storeSetting = SharedFunctions.GetStoreSetting(this.PortalId, "checkout.tab");
                CurrentCart.CreateCartFromOrder(Conversions.ToString(this.PortalId), orderID, false);
                if (Versioned.IsNumeric(storeSetting))
                {
                    this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(Conversions.ToInteger(storeSetting)));
                }
            }
        }

        private void dgOrderList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            NB_Store_OrdersInfo dataItem = (NB_Store_OrdersInfo) e.Item.DataItem;
            OrderController controller = new OrderController();
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                if (this._StatusList.ContainsKey(dataItem.OrderStatusID))
                {
                    e.Item.Cells[5].Text = Conversions.ToString(this._StatusList[dataItem.OrderStatusID]);
                }
                NB_Store_AddressInfo orderAddress = controller.GetOrderAddress(dataItem.BillingAddressID);
                if (orderAddress != null)
                {
                    e.Item.Cells[3].Text = orderAddress.AddressName + " " + orderAddress.AddressName2;
                }
                if (((dataItem.OrderStatusID != 60) & (dataItem.OrderStatusID != 80)) & (dataItem.OrderStatusID != 90))
                {
                    e.Item.Cells[7].Visible = false;
                }
            }
        }

        private void dgOrderList_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
        {
            this.dgOrderList.CurrentPageIndex = e.NewPageIndex;
            this.populateOrderList(this._UsrId);
        }

        private string GetEditUrl(int OrderID)
        {
            if ((this.Request.QueryString["uid"] != null) & (this.Request.QueryString["rtnctl"] != null))
            {
                return this.EditUrl("OrdId", OrderID.ToString(), "AdminOrders", new string[] { "uid=" + this.Request.QueryString["uid"], "rtnctl=" + this.Request.QueryString["rtnctl"], "ed=1" });
            }
            return this.EditUrl("OrdId", OrderID.ToString(), "AdminOrders", new string[] { "ed=1" });
        }

        private void Page_Init1(object sender, EventArgs e)
        {
            this._EditData = "";
            if (this.Request.QueryString["ed"] != null)
            {
                this._EditData = this.Request.QueryString["ed"];
            }
            this._RecalcCart = false;
            if (this.Request.QueryString["rc"] != null)
            {
                this._RecalcCart = true;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (this.Request.QueryString["OrdId"] != null)
                {
                    this._OrdId = int.Parse(this.Request.QueryString["OrdId"]);
                }
                else
                {
                    this._OrdId = -1;
                }
                if (this.Request.QueryString["uid"] != null)
                {
                    this._UsrId = int.Parse(this.Request.QueryString["uid"]);
                }
                else
                {
                    this._UsrId = -1;
                }
                if ((this._UsrId > 0) & (this.Request.QueryString["rtnctl"] != null))
                {
                    this.cmdReturn.Visible = true;
                }
                else
                {
                    this.cmdReturn.Visible = false;
                }
                if (SharedFunctions.GetStoreSettingBoolean(this.PortalId, "orderedititems.flag"))
                {
                    if (SharedFunctions.getAdminCookieValue(this.PortalId, "OrderEditRtnURL") != "")
                    {
                        this._RecalcCart = true;
                        SharedFunctions.setAdminCookieValue(this.PortalId, "OrderEditRtnURL", "");
                    }
                    this.cartlist1.Visible = true;
                    this.cartlist1.HideTotals = true;
                    this.cartlist1.NoUpdates = false;
                    this.cartlist1.ResourceFile = this.LocalResourceFile;
                    this.cartlist1.AllowPriceEdit = SharedFunctions.GetStoreSettingBoolean(this.PortalId, "ordereditprice.flag");
                }
                if (!this.Page.IsPostBack)
                {
                    if (this._OrdId == -1)
                    {
                        this.populateOrderList(this._UsrId);
                    }
                    else
                    {
                        this.populateOrderView(this._OrdId);
                    }
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exc = exception1;
                DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException((PortalModuleBase) this, exc);
                ProjectData.ClearProjectError();
            }
        }

        private void populateOrderList(int UsrID)
        {
            OrderController controller = new OrderController();
            ArrayList list = null;
            this.cmdCreate.Attributes.Add("onClick", "javascript:return confirm('" + DotNetNuke.Services.Localization.Localization.GetString("cmdCreateMsg", this.LocalResourceFile) + "');");
            if (!SharedFunctions.IsManager(this.PortalId, this.UserInfo))
            {
                this.cmdCreate.Visible = false;
            }
            if (this.ModuleConfiguration.ModuleControl.ControlType == SecurityAccessLevel.View)
            {
                this.cmdReturn.Visible = false;
                this.ddlSearch.Visible = false;
            }
            this.pnlOrderEdit.Visible = false;
            this.pnlOrderList.Visible = true;
            this.hypFromDate.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(this.txtFromDate);
            this.hypFromDate.Text = "";
            this.hypFromDate.ImageUrl = "~/images/calendar.png";
            this.hypToDate.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(this.txtToDate);
            this.hypToDate.Text = "";
            this.hypToDate.ImageUrl = "~/images/calendar.png";
            DataGrid dgOrderList = this.dgOrderList;
            DotNetNuke.Services.Localization.Localization.LocalizeDataGrid(ref dgOrderList, this.LocalResourceFile);
            this.dgOrderList = dgOrderList;
            if (!this.Page.IsPostBack)
            {
                SharedFunctions.populateStatusList(this.ddlSearch, "0", DotNetNuke.Services.Localization.Localization.GetString("SelectAll", this.LocalResourceFile), "");
            }
            if (!SharedFunctions.IsEditor(this.PortalId, this.UserInfo))
            {
                UsrID = this.UserInfo.UserID;
            }
            if (this.UserInfo.UserID >= 0)
            {
                if (!string.IsNullOrEmpty(this.txtOrderNbr.Text))
                {
                    if (Versioned.IsNumeric(this.txtOrderNbr.Text))
                    {
                        list = new ArrayList();
                        NB_Store_OrdersInfo order = controller.GetOrder(Conversions.ToInteger(this.txtOrderNbr.Text));
                        if (((order != null) && ((order.UserID == UsrID) | SharedFunctions.IsEditor(this.PortalId, this.UserInfo))) && (order != null))
                        {
                            list.Add(order);
                        }
                    }
                }
                else
                {
                    int num=0;
                    if (!Information.IsDate(this.txtFromDate.Text) | !Information.IsDate(this.txtToDate.Text))
                    {
                        string expression = SharedFunctions.getStoreCookieValue(this.PortalId, "SearchOrderDates", "From");
                        string str2 = SharedFunctions.getStoreCookieValue(this.PortalId, "SearchOrderDates", "To");
                        if (Information.IsDate(expression))
                        {
                            this.txtFromDate.Text = expression;
                        }
                        else
                        {
                            this.txtFromDate.Text = DateAndTime.DateAdd(DateInterval.Month, -1.0, DateAndTime.Today).ToString("d");
                        }
                        if (Information.IsDate(str2))
                        {
                            this.txtToDate.Text = str2;
                        }
                        else
                        {
                            this.txtToDate.Text = DateAndTime.Today.ToString("d");
                        }
                        this.txtOrderNbr.Text = SharedFunctions.getStoreCookieValue(this.PortalId, "SearchOrderDates", "txtOrderNbr");
                        this.txtFilter.Text = SharedFunctions.getStoreCookieValue(this.PortalId, "SearchOrderDates", "txtFilter");
                        this.ddlSearch.Text = SharedFunctions.getStoreCookieValue(this.PortalId, "SearchOrderDates", "ddlSearch");
                    }
                    if (!this.ddlSearch.Visible)
                    {
                        num = 0;
                    }
                    else
                    {
                        num = Conversions.ToInteger(this.ddlSearch.SelectedValue);
                    }
                    list = controller.GetOrderList(this.PortalId, UsrID, Conversions.ToDate(this.txtFromDate.Text), Conversions.ToDate(this.txtToDate.Text), num, this.txtFilter.Text);
                }
                if (list != null)
                {
                    if (!SharedFunctions.IsManager(this.PortalId, this.UserInfo))
                    {
                        for (int i = list.Count - 1; i >= 0; i += -1)
                        {
                            if (((NB_Store_OrdersInfo) list[i]).OrderNumber == "")
                            {
                                list.RemoveAt(i);
                            }
                        }
                    }
                    this._StatusList = SharedFunctions.getStatusList(SharedFunctions.GetCurrentCulture());
                    int num2 = SharedFunctions.GetStoreSettingInt(this.PortalId, "adminorder.pagesize", "None");
                    if (num2 > 0)
                    {
                        this.dgOrderList.PageSize = num2;
                    }
                    this.dgOrderList.DataSource = list;
                    this.dgOrderList.DataBind();
                }
            }
        }

        private void populateOrderView(int OrderID)
        {
            OrderController controller = new OrderController();
            NB_Store_OrdersInfo objOrderInfo = null;
            string strSourceText = "";
            this.pnlOrderEdit.Visible = true;
            this.pnlOrderList.Visible = false;
            this.cmdSendShipEmail.Attributes.Add("onClick", "javascript:return confirm('" + DotNetNuke.Services.Localization.Localization.GetString("cmdSendShipEmailMsg", this.LocalResourceFile) + "');");
            this.cmdSendValidateOrder.Attributes.Add("onClick", "javascript:return confirm('" + DotNetNuke.Services.Localization.Localization.GetString("cmdSendValidateOrderMsg", this.LocalResourceFile) + "');");
            this.cmdSendReceiptEmail.Attributes.Add("onClick", "javascript:return confirm('" + DotNetNuke.Services.Localization.Localization.GetString("cmdSendreceiptEmailMsg", this.LocalResourceFile) + "');");
            this.cmdSendAmendEmail.Attributes.Add("onClick", "javascript:return confirm('" + DotNetNuke.Services.Localization.Localization.GetString("cmdSendAmendEmailMsg", this.LocalResourceFile) + "');");
            this.cmdSendAmendEmail.Visible = false;
            strSourceText = SharedFunctions.GetStoreSettingText(this.PortalId, "orderview.text", SharedFunctions.GetCurrentCulture(), this.UserInfo);
            objOrderInfo = controller.GetOrder(OrderID);
            if (objOrderInfo != null)
            {
                strSourceText = new TokenStoreReplace(objOrderInfo, SharedFunctions.GetCurrentCulture()).DoTokenReplace(strSourceText);
                if (SharedFunctions.GetClientEmail(this.PortalId, objOrderInfo) == "")
                {
                    this.cmdSendReceiptEmail.Visible = false;
                    this.cmdSendShipEmail.Visible = false;
                    this.cmdSendValidateOrder.Visible = false;
                    this.cmdSendAmendEmail.Visible = false;
                }
                this.plhOrder.Controls.Add(new LiteralControl(this.Server.HtmlDecode(strSourceText)));
                if (SharedFunctions.IsEditor(this.PortalId, this.UserInfo) | (objOrderInfo.UserID == this.UserInfo.UserID))
                {
                    if (this._EditData != "")
                    {
                        this.pnlEdit.Visible = true;
                        this.pnlUpdate.Visible = false;
                        this.cmdEditOrder.Visible = false;
                        this.plhOrder.Visible = false;
                        this.cmdSendReceiptEmail.Visible = false;
                        this.cmdSendShipEmail.Visible = false;
                        this.cmdSendValidateOrder.Visible = false;
                        this.cmdReOrder.Visible = false;
                        this.cmdPrintOrder.Visible = false;
                        this.cmdPrintreceipt.Visible = false;
                        NB_Store_AddressInfo orderAddress = controller.GetOrderAddress(objOrderInfo.BillingAddressID);
                        if (orderAddress != null)
                        {
                            this.EditBAddrForm.TemplateName = "rab_editaddress.template";
                            this.EditBAddrForm.AddressDataInfo = orderAddress;
                        }
                        orderAddress = controller.GetOrderAddress(objOrderInfo.ShippingAddressID);
                        if (orderAddress != null)
                        {
                            this.EditSAddrForm.TemplateName = "rab_editaddress.template";
                            this.EditSAddrForm.AddressDataInfo = orderAddress;
                        }
                        this.txtEditNoteMsg.Text = objOrderInfo.NoteMsg;
                        if (SharedFunctions.IsManager(this.PortalId, this.UserInfo))
                        {
                            if (decimal.Compare(objOrderInfo.AlreadyPaid, decimal.Zero) > 0)
                            {
                                this.txtAlreadyPaid.Text = Conversions.ToString(objOrderInfo.AlreadyPaid);
                                this.txtAlreadyPaid.Text = Conversions.ToDouble(this.txtAlreadyPaid.Text).ToString();
                            }
                            else
                            {
                                this.txtAlreadyPaid.Text = Conversions.ToString(0);
                            }
                        }
                        else
                        {
                            this.txtAlreadyPaid.Visible = false;
                            this.lblAlreadyPaid.Visible = false;
                        }
                        if (SharedFunctions.GetStoreSettingBoolean(this.PortalId, "orderedititems.flag"))
                        {
                            if (!this._RecalcCart)
                            {
                                this.cartlist1.CartID = CurrentCart.CreateCartFromOrder(Conversions.ToString(this.PortalId), objOrderInfo.OrderID, false);
                            }
                            else
                            {
                                this.cartlist1.CartID = CurrentCart.getCartID(this.PortalId);
                            }
                            this.cartlist1.PopulateCartList();
                            this.cmdAddProduct.Visible = true;
                        }
                        else
                        {
                            this.cartlist1.Visible = false;
                            this.cmdAddProduct.Visible = false;
                        }
                        this.txtOrderEmail.Text = SharedFunctions.GetClientEmail(this.PortalId, objOrderInfo);
                    }
                    else
                    {
                        this.cmdEditOrder.Visible = false;
                        if (((objOrderInfo.OrderStatusID < 50) | (objOrderInfo.OrderStatusID >= 80)) && SharedFunctions.GetStoreSettingBoolean(this.PortalId, "orderedit.flag"))
                        {
                            this.cmdEditOrder.Visible = true;
                            if (SharedFunctions.IsEditor(this.PortalId, this.UserInfo))
                            {
                                if ((objOrderInfo.OrderGUID != "") & (SharedFunctions.GetClientEmail(this.PortalId, objOrderInfo) != ""))
                                {
                                    this.cmdSendAmendEmail.Visible = true;
                                }
                            }
                            else if (objOrderInfo.UserID == this.UserInfo.UserID)
                            {
                                if (SharedFunctions.GetStoreSettingBoolean(this.PortalId, "ordereditclient.flag"))
                                {
                                    this.cmdEditOrder.Visible = true;
                                }
                                else
                                {
                                    this.cmdEditOrder.Visible = false;
                                }
                            }
                        }
                    }
                }
            }
            if (SharedFunctions.IsEditor(this.PortalId, this.UserInfo))
            {
                this.pnlUpdate.Visible = true;
                this.cmdUpdate.Visible = true;
                if (SharedFunctions.GetStoreSettingText(this.PortalId, "receiptprint.text", SharedFunctions.GetCurrentCulture()) == "")
                {
                    this.cmdSendReceiptEmail.Visible = false;
                    this.cmdPrintreceipt.Visible = false;
                }
                if (objOrderInfo == null)
                {
                    objOrderInfo = controller.GetOrder(OrderID);
                }
                if (objOrderInfo != null)
                {
                    this.hypShipDate.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(this.txtShipDate);
                    this.hypShipDate.Text = "";
                    this.hypShipDate.ImageUrl = "~/images/calendar.png";
                    SharedFunctions.populateStatusList(this.ddlStatus, "", "", Conversions.ToString(objOrderInfo.OrderStatusID));
                    if (DateTime.Compare(objOrderInfo.ShipDate, Null.NullDate) != 0)
                    {
                        this.txtShipDate.Text = objOrderInfo.ShipDate.ToString("d");
                    }
                    else
                    {
                        this.txtShipDate.Text = "";
                    }
                    this.txtTrackCode.Text = objOrderInfo.TrackingCode;
                }
            }
            else
            {
                this.pnlUpdate.Visible = false;
                this.cmdUpdate.Visible = false;
                this.cmdPrintreceipt.Visible = false;
                if (this.UserInfo.UserID != objOrderInfo.UserID)
                {
                    this.pnlOrderEdit.Visible = false;
                }
            }
        }

        private void RedirectAfterEdit()
        {
            CurrentCart.DeleteCart(this.PortalId);
            if (this.plhOrder.Visible)
            {
                if ((this.Request.QueryString["uid"] != null) & (this.Request.QueryString["rtnctl"] != null))
                {
                    this.Response.Redirect(this.EditUrl("uid", this.Request.QueryString["uid"], "AdminOrders", new string[] { "rtnctl=" + this.Request.QueryString["rtnctl"] }));
                }
                else
                {
                    this.Response.Redirect(this.EditUrl("AdminOrders"));
                }
            }
            else if ((this.Request.QueryString["uid"] != null) & (this.Request.QueryString["rtnctl"] != null))
            {
                this.Response.Redirect(this.EditUrl("uid", this.Request.QueryString["uid"], "AdminOrders", new string[] { "rtnctl=" + this.Request.QueryString["rtnctl"], "OrdId=" + Conversions.ToString(this._OrdId) }));
            }
            else
            {
                this.Response.Redirect(this.EditUrl("OrdId", this._OrdId.ToString(), "AdminOrders"));
            }
        }

        private void RedirectAfterEmail()
        {
            if (this.Request.QueryString["ctl"] != "")
            {
                this.Response.Redirect(this.EditUrl("OrdId", this._OrdId.ToString(), this.Request.QueryString["ctl"]));
            }
            else
            {
                this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabId, "", new string[] { "OrdId=" + this._OrdId.ToString() }));
            }
        }

        private void SaveSearchCriteria()
        {
            if (Information.IsDate(this.txtFromDate.Text))
            {
                SharedFunctions.setStoreCookieValue(this.PortalId, "SearchOrderDates", "From", this.txtFromDate.Text, 0.0);
            }
            if (Information.IsDate(this.txtToDate.Text))
            {
                SharedFunctions.setStoreCookieValue(this.PortalId, "SearchOrderDates", "To", this.txtToDate.Text, 0.0);
            }
            SharedFunctions.setStoreCookieValue(this.PortalId, "SearchOrderDates", "txtOrderNbr", this.txtOrderNbr.Text, 0.0);
            SharedFunctions.setStoreCookieValue(this.PortalId, "SearchOrderDates", "txtFilter", this.txtFilter.Text, 0.0);
            SharedFunctions.setStoreCookieValue(this.PortalId, "SearchOrderDates", "ddlSearch", this.ddlSearch.SelectedValue, 0.0);
        }

        private void SendOrderEmail(string EmailTemplateName)
        {
            NB_Store_OrdersInfo order = new OrderController().GetOrder(this._OrdId);
            if (order != null)
            {
                int actionsID = 0;
                switch (EmailTemplateName)
                {
                    case "ordershipped.email":
                        actionsID = 60;
                        break;

                    case "ordervalidated.email":
                        actionsID = 50;
                        break;

                    case "orderreceipt.email":
                        actionsID = 80;
                        break;

                    case "orderamended.email":
                        actionsID = 70;
                        break;
                }
                if (actionsID > 0)
                {
                    SharedFunctions.updateOrderActionLog(order, this.UserInfo, actionsID);
                }
                SharedFunctions.SendEmailToClient(this.PortalId, SharedFunctions.GetClientEmail(this.PortalId, order), "", order, EmailTemplateName, SharedFunctions.GetClientLang(this.PortalId, order));
                SharedFunctions.UpdateLog("EMAILSENT : " + EmailTemplateName);
            }
        }

        private void updateOrder()
        {
            OrderController controller = new OrderController();
            NB_Store_OrdersInfo objInfo = null;
            bool flag = false;
            objInfo = controller.GetOrder(this._OrdId);
            if (objInfo != null)
            {
                if (this.ddlStatus.Visible)
                {
                    if (objInfo.OrderStatusID != Conversions.ToDouble(this.ddlStatus.SelectedValue))
                    {
                        flag = true;
                        objInfo.OrderStatusID = Conversions.ToInteger(this.ddlStatus.SelectedValue);
                    }
                    objInfo.TrackingCode = this.txtTrackCode.Text;
                    if ((objInfo.OrderStatusID == 40) & (objInfo.OrderNumber == ""))
                    {
                        int userID = objInfo.UserID;
                        if (userID == -1)
                        {
                            userID = 0;
                        }
                        objInfo.OrderNumber = Strings.Format(this.PortalId, "00") + "-" + userID.ToString("0000#") + "-" + objInfo.OrderID.ToString("0000#") + "-" + objInfo.OrderDate.ToString("yyyyMMdd");
                    }
                    if (Information.IsDate(this.txtShipDate.Text))
                    {
                        objInfo.ShipDate = Conversions.ToDate(this.txtShipDate.Text);
                    }
                }
                if (this.pnlEdit.Visible)
                {
                    string orderXML = new Export().GetOrderXML(objInfo.OrderID);
                    SharedFunctions.UpdateLog(this.UserId, orderXML);
                    NB_Store_AddressInfo addressDataInfo = this.EditBAddrForm.AddressDataInfo;
                    addressDataInfo.OrderID = objInfo.OrderID;
                    addressDataInfo.UserID = this.UserId;
                    addressDataInfo.CreatedDate = DateAndTime.Now;
                    addressDataInfo.CreatedByUser = Conversions.ToString(this.UserId);
                    if (objInfo.BillingAddressID > 0)
                    {
                        addressDataInfo.AddressID = objInfo.BillingAddressID;
                        controller.UpdateObjOrderAddress(addressDataInfo);
                    }
                    else
                    {
                        addressDataInfo = controller.UpdateObjOrderAddress(addressDataInfo);
                        objInfo.BillingAddressID = addressDataInfo.AddressID;
                    }
                    addressDataInfo = this.EditSAddrForm.AddressDataInfo;
                    addressDataInfo.OrderID = objInfo.OrderID;
                    addressDataInfo.UserID = this.UserId;
                    addressDataInfo.CreatedDate = DateAndTime.Now;
                    addressDataInfo.CreatedByUser = Conversions.ToString(this.UserId);
                    if (objInfo.ShippingAddressID == objInfo.BillingAddressID)
                    {
                        addressDataInfo.AddressID = -1;
                        addressDataInfo = controller.UpdateObjOrderAddress(addressDataInfo);
                        objInfo.ShippingAddressID = addressDataInfo.AddressID;
                    }
                    else if (objInfo.ShippingAddressID > 0)
                    {
                        addressDataInfo.AddressID = objInfo.ShippingAddressID;
                        controller.UpdateObjOrderAddress(addressDataInfo);
                    }
                    else
                    {
                        addressDataInfo = controller.UpdateObjOrderAddress(addressDataInfo);
                        objInfo.ShippingAddressID = addressDataInfo.AddressID;
                    }
                    if (this.txtEditNoteMsg.Visible)
                    {
                        objInfo.NoteMsg = this.txtEditNoteMsg.Text;
                    }
                    if (this.txtOrderEmail.Visible)
                    {
                        objInfo.Email = this.txtOrderEmail.Text;
                    }
                    if (this.cartlist1.Visible)
                    {
                        CurrentCart.CreateOrderDetails(this.PortalId, objInfo.OrderID);
                        NB_Store_CartInfo currentCart = CurrentCart.GetCurrentCart(this.PortalId);
                        currentCart.ShipMethodID = objInfo.ShipMethodID;
                        objInfo = CurrentCart.CreateOrderTotals(objInfo, currentCart);
                        objInfo.OrderGUID = Guid.NewGuid().ToString();
                        SharedFunctions.updateOrderActionLog(objInfo, this.UserInfo, 90);
                    }
                    if ((this.txtAlreadyPaid.Visible && Versioned.IsNumeric(this.txtAlreadyPaid.Text)) && (decimal.Compare(Conversions.ToDecimal(this.txtAlreadyPaid.Text), decimal.Zero) >= 0))
                    {
                        objInfo.AlreadyPaid = Conversions.ToDecimal(this.txtAlreadyPaid.Text);
                    }
                    if (decimal.Compare(objInfo.AlreadyPaid, objInfo.Total) < 0)
                    {
                        objInfo.OrderStatusID = 90;
                    }
                    double number = SharedFunctions.GetStoreSettingInt(this.PortalId, "elapsedorderhours.limit", "None");
                    if (number > 0.0)
                    {
                        objInfo.ElapsedDate = DateAndTime.DateAdd(DateInterval.Hour, number, DateAndTime.Today);
                    }
                }
                if (flag)
                {
                    SharedFunctions.updateOrderActionLog(objInfo, this.UserInfo, 40);
                }
                controller.UpdateObjOrder(objInfo);
                if (EventInterface.Instance() != null)
                {
                    EventInterface.Instance().EditOrderUpdate(this.PortalId, objInfo.OrderID);
                }
            }
        }

        protected virtual CartList cartlist1
        {
            get
            {
                return this._cartlist1;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                CartList.RecalculateCartEventHandler handler = new CartList.RecalculateCartEventHandler(this.cartlist1_RecalculateCart);
                if (this._cartlist1 != null)
                {
                    this._cartlist1.RecalculateCart -= handler;
                }
                this._cartlist1 = value;
                if (this._cartlist1 != null)
                {
                    this._cartlist1.RecalculateCart += handler;
                }
            }
        }

        protected virtual LinkButton cmdAddProduct
        {
            get
            {
                return this._cmdAddProduct;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdAddProduct_Click);
                if (this._cmdAddProduct != null)
                {
                    this._cmdAddProduct.Click -= handler;
                }
                this._cmdAddProduct = value;
                if (this._cmdAddProduct != null)
                {
                    this._cmdAddProduct.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdCreate
        {
            get
            {
                return this._cmdCreate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdCreate_Click);
                if (this._cmdCreate != null)
                {
                    this._cmdCreate.Click -= handler;
                }
                this._cmdCreate = value;
                if (this._cmdCreate != null)
                {
                    this._cmdCreate.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdEditOrder
        {
            get
            {
                return this._cmdEditOrder;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdEditOrder_Click);
                if (this._cmdEditOrder != null)
                {
                    this._cmdEditOrder.Click -= handler;
                }
                this._cmdEditOrder = value;
                if (this._cmdEditOrder != null)
                {
                    this._cmdEditOrder.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdPrintOrder
        {
            get
            {
                return this._cmdPrintOrder;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdPrintOrder_Click);
                if (this._cmdPrintOrder != null)
                {
                    this._cmdPrintOrder.Click -= handler;
                }
                this._cmdPrintOrder = value;
                if (this._cmdPrintOrder != null)
                {
                    this._cmdPrintOrder.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdPrintreceipt
        {
            get
            {
                return this._cmdPrintreceipt;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdPrintreceipt_Click);
                if (this._cmdPrintreceipt != null)
                {
                    this._cmdPrintreceipt.Click -= handler;
                }
                this._cmdPrintreceipt = value;
                if (this._cmdPrintreceipt != null)
                {
                    this._cmdPrintreceipt.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdReOrder
        {
            get
            {
                return this._cmdReOrder;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdReOrder_Click);
                if (this._cmdReOrder != null)
                {
                    this._cmdReOrder.Click -= handler;
                }
                this._cmdReOrder = value;
                if (this._cmdReOrder != null)
                {
                    this._cmdReOrder.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdReturn
        {
            get
            {
                return this._cmdReturn;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdReturn_Click);
                if (this._cmdReturn != null)
                {
                    this._cmdReturn.Click -= handler;
                }
                this._cmdReturn = value;
                if (this._cmdReturn != null)
                {
                    this._cmdReturn.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdReturn2
        {
            get
            {
                return this._cmdReturn2;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdReturn2_Click);
                if (this._cmdReturn2 != null)
                {
                    this._cmdReturn2.Click -= handler;
                }
                this._cmdReturn2 = value;
                if (this._cmdReturn2 != null)
                {
                    this._cmdReturn2.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdSelect
        {
            get
            {
                return this._cmdSelect;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdSelect_Click);
                if (this._cmdSelect != null)
                {
                    this._cmdSelect.Click -= handler;
                }
                this._cmdSelect = value;
                if (this._cmdSelect != null)
                {
                    this._cmdSelect.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdSendAmendEmail
        {
            get
            {
                return this._cmdSendAmendEmail;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdSendAmendEmail_Click);
                if (this._cmdSendAmendEmail != null)
                {
                    this._cmdSendAmendEmail.Click -= handler;
                }
                this._cmdSendAmendEmail = value;
                if (this._cmdSendAmendEmail != null)
                {
                    this._cmdSendAmendEmail.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdSendReceiptEmail
        {
            get
            {
                return this._cmdSendReceiptEmail;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdSendReceiptEmail_Click);
                if (this._cmdSendReceiptEmail != null)
                {
                    this._cmdSendReceiptEmail.Click -= handler;
                }
                this._cmdSendReceiptEmail = value;
                if (this._cmdSendReceiptEmail != null)
                {
                    this._cmdSendReceiptEmail.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdSendShipEmail
        {
            get
            {
                return this._cmdSendShipEmail;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdSendShipEmail_Click);
                if (this._cmdSendShipEmail != null)
                {
                    this._cmdSendShipEmail.Click -= handler;
                }
                this._cmdSendShipEmail = value;
                if (this._cmdSendShipEmail != null)
                {
                    this._cmdSendShipEmail.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdSendValidateOrder
        {
            get
            {
                return this._cmdSendValidateOrder;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdSendValidateOrder_Click);
                if (this._cmdSendValidateOrder != null)
                {
                    this._cmdSendValidateOrder.Click -= handler;
                }
                this._cmdSendValidateOrder = value;
                if (this._cmdSendValidateOrder != null)
                {
                    this._cmdSendValidateOrder.Click += handler;
                }
            }
        }

        protected virtual LinkButton cmdUpdate
        {
            get
            {
                return this._cmdUpdate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.cmdUpdate_Click);
                if (this._cmdUpdate != null)
                {
                    this._cmdUpdate.Click -= handler;
                }
                this._cmdUpdate = value;
                if (this._cmdUpdate != null)
                {
                    this._cmdUpdate.Click += handler;
                }
            }
        }

        protected virtual CompareValidator CompareValidator1
        {
            get
            {
                return this._CompareValidator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._CompareValidator1 = value;
            }
        }

        protected virtual CompareValidator cvFromDate
        {
            get
            {
                return this._cvFromDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._cvFromDate = value;
            }
        }

        protected virtual CompareValidator cvToDate
        {
            get
            {
                return this._cvToDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._cvToDate = value;
            }
        }

        protected virtual DropDownList ddlSearch
        {
            get
            {
                return this._ddlSearch;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                EventHandler handler = new EventHandler(this.ddlSearch_SelectedIndexChanged);
                if (this._ddlSearch != null)
                {
                    this._ddlSearch.SelectedIndexChanged -= handler;
                }
                this._ddlSearch = value;
                if (this._ddlSearch != null)
                {
                    this._ddlSearch.SelectedIndexChanged += handler;
                }
            }
        }

        protected virtual DropDownList ddlStatus
        {
            get
            {
                return this._ddlStatus;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._ddlStatus = value;
            }
        }

        protected virtual DataGrid dgOrderList
        {
            get
            {
                return this._dgOrderList;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                DataGridCommandEventHandler handler = new DataGridCommandEventHandler(this.dgOrderList_EditCommand);
                DataGridPageChangedEventHandler handler2 = new DataGridPageChangedEventHandler(this.dgOrderList_PageIndexChanged);
                DataGridItemEventHandler handler3 = new DataGridItemEventHandler(this.dgOrderList_ItemDataBound);
                DataGridCommandEventHandler handler4 = new DataGridCommandEventHandler(this.dgOrderList_ItemCommand);
                if (this._dgOrderList != null)
                {
                    this._dgOrderList.EditCommand -= handler;
                    this._dgOrderList.PageIndexChanged -= handler2;
                    this._dgOrderList.ItemDataBound -= handler3;
                    this._dgOrderList.ItemCommand -= handler4;
                }
                this._dgOrderList = value;
                if (this._dgOrderList != null)
                {
                    this._dgOrderList.EditCommand += handler;
                    this._dgOrderList.PageIndexChanged += handler2;
                    this._dgOrderList.ItemDataBound += handler3;
                    this._dgOrderList.ItemCommand += handler4;
                }
            }
        }

        protected virtual Address EditBAddrForm
        {
            get
            {
                return this._EditBAddrForm;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._EditBAddrForm = value;
            }
        }

        protected virtual Address EditSAddrForm
        {
            get
            {
                return this._EditSAddrForm;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._EditSAddrForm = value;
            }
        }

        protected virtual HyperLink hypFromDate
        {
            get
            {
                return this._hypFromDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._hypFromDate = value;
            }
        }

        protected virtual HyperLink hypShipDate
        {
            get
            {
                return this._hypShipDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._hypShipDate = value;
            }
        }

        protected virtual HyperLink hypToDate
        {
            get
            {
                return this._hypToDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._hypToDate = value;
            }
        }

        protected virtual Label lblAlreadyPaid
        {
            get
            {
                return this._lblAlreadyPaid;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblAlreadyPaid = value;
            }
        }

        protected virtual Label lblFrom
        {
            get
            {
                return this._lblFrom;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblFrom = value;
            }
        }

        protected virtual Label lblName
        {
            get
            {
                return this._lblName;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblName = value;
            }
        }

        protected virtual Label lblOrderEmail
        {
            get
            {
                return this._lblOrderEmail;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblOrderEmail = value;
            }
        }

        protected virtual Label lblOrderNbr
        {
            get
            {
                return this._lblOrderNbr;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblOrderNbr = value;
            }
        }

        protected virtual Label lblPopupMsg
        {
            get
            {
                return this._lblPopupMsg;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblPopupMsg = value;
            }
        }

        protected virtual Label lblShipDate
        {
            get
            {
                return this._lblShipDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblShipDate = value;
            }
        }

        protected virtual Label lblStatus
        {
            get
            {
                return this._lblStatus;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblStatus = value;
            }
        }

        protected virtual Label lblTo
        {
            get
            {
                return this._lblTo;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblTo = value;
            }
        }

        protected virtual Label lblTrackCode
        {
            get
            {
                return this._lblTrackCode;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._lblTrackCode = value;
            }
        }

        protected virtual PlaceHolder plhOrder
        {
            get
            {
                return this._plhOrder;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._plhOrder = value;
            }
        }

        protected virtual Panel pnlEdit
        {
            get
            {
                return this._pnlEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._pnlEdit = value;
            }
        }

        protected virtual Panel pnlOrderEdit
        {
            get
            {
                return this._pnlOrderEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._pnlOrderEdit = value;
            }
        }

        protected virtual Panel pnlOrderList
        {
            get
            {
                return this._pnlOrderList;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._pnlOrderList = value;
            }
        }

        protected virtual Panel pnlUpdate
        {
            get
            {
                return this._pnlUpdate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._pnlUpdate = value;
            }
        }

        protected virtual TextBox txtAlreadyPaid
        {
            get
            {
                return this._txtAlreadyPaid;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtAlreadyPaid = value;
            }
        }

        protected virtual TextBox txtEditNoteMsg
        {
            get
            {
                return this._txtEditNoteMsg;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtEditNoteMsg = value;
            }
        }

        protected virtual TextBox txtFilter
        {
            get
            {
                return this._txtFilter;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtFilter = value;
            }
        }

        protected virtual TextBox txtFromDate
        {
            get
            {
                return this._txtFromDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtFromDate = value;
            }
        }

        protected virtual TextBox txtOrderEmail
        {
            get
            {
                return this._txtOrderEmail;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtOrderEmail = value;
            }
        }

        protected virtual TextBox txtOrderNbr
        {
            get
            {
                return this._txtOrderNbr;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtOrderNbr = value;
            }
        }

        protected virtual TextBox txtShipDate
        {
            get
            {
                return this._txtShipDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtShipDate = value;
            }
        }

        protected virtual TextBox txtToDate
        {
            get
            {
                return this._txtToDate;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtToDate = value;
            }
        }

        protected virtual TextBox txtTrackCode
        {
            get
            {
                return this._txtTrackCode;
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                this._txtTrackCode = value;
            }
        }
    }
}

